package core.cards;

import java.util.List;



/**
 * Klasa odpowiedzialna za wizualizację wyników po stronie CKW.
 * 
 * @author DooM
 */
public abstract class CardResultBackend {
	
	public CardResultBackend() {
	}
	
	public void addVote(IFormBackend vote, String locatorUri) {
		addVoteToGeneral(vote);
		addVoteToRkw(vote, locatorUri);
	}
	
	public void addVotes(String locatorUri, List<IFormBackend> votes) {
		for(IFormBackend vote : votes) {
			addVote(vote, locatorUri);
		}
	}
	
	public void increaseVotersCount(int votersCount, String locatorUri) {
		increaseVotersCountForGeneral(votersCount);
		if(locatorUri != null) {
			increaseVotersCountForRkw(votersCount, locatorUri);
		}
	}

	protected abstract void addVoteToGeneral(IFormBackend vote);
	protected abstract void addVoteToRkw(IFormBackend vote, String locatorUri);
	
	protected abstract void increaseVotersCountForGeneral(int votersCount);
	protected abstract void increaseVotersCountForRkw(int votersCount, String locatorUri);
}
